package com.ruoyi.project.loans.payment.service;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.loans.payment.mapper.PaymentDetailMapper;
import com.ruoyi.project.loans.payment.domain.PaymentDetail;
import com.ruoyi.project.loans.payment.service.IPaymentDetailService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 还款计划 服务层实现
 * 
 * @author ruoyi
 * @date 2020-06-18
 */
@Service
public class PaymentDetailServiceImpl implements IPaymentDetailService 
{
	@Autowired
	private PaymentDetailMapper paymentDetailMapper;

	/**
     * 查询还款计划信息
     * 
     * @param id 还款计划ID
     * @return 还款计划信息
     */
    @Override
	public PaymentDetail selectPaymentDetailById(Integer id)
	{
	    return paymentDetailMapper.selectPaymentDetailById(id);
	}
	
	/**
     * 查询还款计划列表
     * 
     * @param paymentDetail 还款计划信息
     * @return 还款计划集合
     */
	@Override
	public List<PaymentDetail> selectPaymentDetailList(PaymentDetail paymentDetail)
	{
	    return paymentDetailMapper.selectPaymentDetailList(paymentDetail);
	}
	
    /**
     * 新增还款计划
     * 
     * @param paymentDetail 还款计划信息
     * @return 结果
     */
	@Override
	public int insertPaymentDetail(PaymentDetail paymentDetail)
	{
	    return paymentDetailMapper.insertPaymentDetail(paymentDetail);
	}
	
	/**
     * 修改还款计划
     * 
     * @param paymentDetail 还款计划信息
     * @return 结果
     */
	@Override
	public int updatePaymentDetail(PaymentDetail paymentDetail)
	{
	    return paymentDetailMapper.updatePaymentDetail(paymentDetail);
	}

	/**
     * 删除还款计划对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	public int deletePaymentDetailByIds(String ids)
	{
		return paymentDetailMapper.deletePaymentDetailByIds(Convert.toStrArray(ids));
	}
	
}
